<?php

class Common_DataObject extends ClassStructure_Mixin_Delegator {

    public function __construct() {
        parent::__construct();
        $this->__addMixin('property');
    }

    public function getCaption() {
        return $this->getProperty('caption', null);
    }

    public function hasCaption() {
        $str = $this->getProperty('caption', null);
        return !empty($str);
    }

    public function setCaption($str_caption) {
        $this->setProperty('caption', (string) $str_caption);
    }

    public function getSource() {
        return $this->getProperty('source', null);
    }

    public function hasSource() {
        $str = $this->getProperty('source', null);
        return !empty($str);
    }

    public function setSource($str_source) {
        $this->setProperty('source', (string) $str_source);
    }
    
    /*public function serialise() {
        $arr_export = $this->export_for_serialise();
        $str_encoded = $this->encode_for_serialise($arr_export);
        return $str_encoded;
    }

    protected function export_for_serialise() {
        $arr_export = array(
            'meta' => $this->getProperty()
        );
        return $arr_export;
    }

    protected function encode_for_serialise($arr) {
        return json_encode($arr);
    }

    static protected function decode_for_unserialise($arr) {
        return json_decode($arr, true);
    }

    public function render($arr_options = array()) {
    }*/

}
